import logging,yagmail
from BeautifulReport import BeautifulReport
class tool():
    def log(self):
        log=logging.basicConfig(level=logging.DEBUG,
                                filename='a3mall_search.log',
                                format='%(levelname)s->%(filename)s->%(asctime)s->%(lineno)d',
                                filemode='a+')
        return log

    def email(self,filename):
        email=yagmail.SMTP(user='3177622011@qq.com',password='xjwzrxaryqjydece',host='smtp.qq.com')
        email.send(to='3177622011@qq.com',subject='a3mall系统Web Ui自动化测试报告',attachments=filename,contents='搜索特殊符号')
        email.close()

    def baogao(self,suite):
        BeautifulReport(suite).report(filename='a3mall_search.html',description='搜索特殊符号de报告')